package com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.entity.ReadyOutMeterList;

import java.util.List;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class NanJingLu_DianBiaoJiHuaChuKuAdapter extends BaseQuickAdapter<ReadyOutMeterList, BaseViewHolder> {

    private Context mContext;
    private INanJingLu_DianBiaoJiHuaChuKuAdapter mINanJingLu_dianBiaoJiHuaChuKuAdapter;

    public NanJingLu_DianBiaoJiHuaChuKuAdapter(Context context, @Nullable List<ReadyOutMeterList> data, INanJingLu_DianBiaoJiHuaChuKuAdapter iNanJingLu_dianBiaoJiHuaChuKuAdapter) {
        super(R.layout.item_nan_jing_lu__dian_biao_ji_hua_chu_ku, data);
        this.mContext = context;
        this.mINanJingLu_dianBiaoJiHuaChuKuAdapter = iNanJingLu_dianBiaoJiHuaChuKuAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, ReadyOutMeterList item) {
        helper.setText(R.id.tv_name, "说明： " + item.getInfo());
        helper.setText(R.id.tv_spname, "仓位： " + item.getSpname());
        helper.setText(R.id.tv_num, "oid： " + item.getOid());
        helper.setText(R.id.tv_taskStatus, "tag:： " + item.getTag());

        helper.setOnClickListener(R.id.btn_chu_ku_agv, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mINanJingLu_dianBiaoJiHuaChuKuAdapter.chuKuAGV(item);
            }
        });
        helper.setOnClickListener(R.id.btn_chu_ku_li_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mINanJingLu_dianBiaoJiHuaChuKuAdapter.chuKuLiKu(item);
            }
        });


    }

    public interface INanJingLu_DianBiaoJiHuaChuKuAdapter {

        void chuKuAGV(ReadyOutMeterList readyOutMeterList);

        void chuKuLiKu(ReadyOutMeterList readyOutMeterList);
    }

}
